<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="net.sf.cglib.reflect.FastClass"%>
<%@page import="net.sf.cglib.reflect.FastMethod"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>Spring Refresh Page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
  </head>
  
  <body>
    
    <%
       WebApplicationContext springContext = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
       FastClass fClass = FastClass.create(springContext.getClass());
       FastMethod destroyMethod = fClass.getMethod("destroy",new Class[]{});
       destroyMethod.invoke(springContext,null);
       FastMethod refreshMethod = fClass.getMethod("refresh",new Class[]{});
       refreshMethod.invoke(springContext,null);
       out.println("refresh already!");
    %>
    
  </body>
</html>
